﻿using MESPro.DBManager;
using MESPro.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace MESPro.Views
{
    public partial class LoginFrm : Form
    {
        public LoginFrm()
        {
            InitializeComponent();
            this.Load += LoginFrm_Load;
        }
        public Model? model;
        public User? user;
        private void LoginFrm_Load(object sender, EventArgs e)
        {
            var res = DbContext.Db.Queryable<Model>().ToList();
            this.comboBox1.DataSource = res;
            comboBox1.DisplayMember = nameof(Model.DisName);
            comboBox1.ValueMember = "Id";
        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            model = comboBox1.SelectedItem as Model;
            ;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
